package com.fable.sp.core.widget;

/**
 * .
 *
 * @author stormning on 16/8/16.
 */
public class MissingWidgetRequestParameterException extends WidgetRequestBindingException {

    private final String parameterName;

    private final String parameterType;


    /**
     * Constructor for MissingPortletRequestParameterException.
     * @param parameterName the name of the missing parameter
     * @param parameterType the expected type of the missing parameter
     */
    public MissingWidgetRequestParameterException(String parameterName, String parameterType) {
        super("");
        this.parameterName = parameterName;
        this.parameterType = parameterType;
    }


    @Override
    public String getMessage() {
        return "Required " + this.parameterType + " parameter '" + parameterName + "' is not present";
    }

    /**
     * Return the name of the offending parameter.
     */
    public final String getParameterName() {
        return this.parameterName;
    }

    /**
     * Return the expected type of the offending parameter.
     */
    public final String getParameterType() {
        return this.parameterType;
    }

}